package com.design.singleton;

/**
 * @Author: ChengLei.Liu
 * @Date: 2020-06-05 14:23
 * @Description: 单例模式(懒汉式)
 *  采用静态内部类的形势 在调用该类其他静态方法时导致该类初始化 并不会导致静态内部类的初始化
 */
public class Singleton06 {

    private Singleton06(){
        System.out.println("Singleton06 被初始化了");
    }

    private static class SingletonInstance{
        private static final Singleton06 INSTANCE = new Singleton06();
    }

    public static Singleton06 getInstance(){
        return SingletonInstance.INSTANCE;
    }

    public static boolean getOther(){
        return false;
    }
}
